<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./../../WEB-INF/templates/noFooterCandidateTemplate.xhtml">
            <ui:define name="content">
               
                    
                <h:form id="offersCandidateViewForm">
                    <p:panel style="min-width: 1000px" styleClass="noBorder noPadding noMargin">
                        <!--<p:dataGrid emptyMessage="#{messages.NoOffers}" var="search" value="#{offersCandidateBean.allUserOffers}" styleClass="offersCandidatePanelWrap" paginator="false" columns="7" >
                            <p:panel styleClass="skillBackgroundDataGridElementlow" id="imagenBusqueda">
                                <div class="divAbstractCompanyOffersCandidate">
                                    <h:graphicImage value="/companyFiles/#{search.company.idCompany.toString()}/images/#{search.company.logo}" styleClass="imagenAbstractCompanyOffersCandidate" rendered="#{search.company.logo!=null}" ></h:graphicImage>
                                </div>
                                <div class="marginTop20">
                                    <h:outputText rendered="#{search!=null}" value="#{search.description}" ></h:outputText>
                                </div>
                                <div class="marginTop20">
                                    <p:commandButton id="candidateLikedOfferButton" disabled="#{offersCandidateBean.exitsCandidateSearchInterest(search)}" update="candidateLikedOfferButton" styleClass="updatePicturesButton languageBackgroundButton" value="#{messages.ILike}" action="#{offersCandidateBean.candidateLikedASearch(search)}"  />
                                </div>
                            </p:panel>
                        </p:dataGrid>!-->
                        
                        <p:dataGrid emptyMessage="#{messages.NoOffers}" styleClass="loadImages offerPanel" id="facesDataGrid" var="search" value="#{offersCandidateBean.allUserOffers}" columns="5" rowIndexVar="rowIndex"  paginator="false" >
                                <p:column selectionMode="single" styleClass="facesColumn noPadding noMargin">
                                    <p:panel style="margin-left: 4px;" styleClass="inlineBlock noPadding noBorder facesPanel">  
                                            <p:outputPanel styleClass="divAbstractCompanyOffersCandidate">
                                                <h:graphicImage value="/companyFiles/#{search.company.idCompany.toString()}/images/#{search.company.logo}" styleClass="imagenLogoOferta" rendered="#{search.company.logo!=null}" ></h:graphicImage>
                                                <h:outputText style="font-size: 17px!important; font-weight: bold" value="#{search.company.name}" rendered="#{search.company.logo==null}"></h:outputText>
                                            </p:outputPanel>
                                            <p:outputPanel style="margin-top: 5px">
                                                <h:outputText  value="#{search.description}" ></h:outputText>
                                            </p:outputPanel>
                                            <p:outputPanel style="margin-top: 5px">
                                                <p:commandButton  onclick="jQuery(this).addClass('ui-state-disabled')" id="candidateLikedOfferButton" disabled="#{offersCandidateBean.exitsCandidateSearchInterest(search)}" styleClass="offersLikeButton languageBackgroundButton" value="#{messages.ILike}" action="#{offersCandidateBean.candidateLikedASearch(search)}" process="@this" />
                                                <p:commandButton  actionListener="#{offersCandidateBean.setSelectedSearch(search)}" id="seeOfferBurrtton" style="margin-left: 5px" styleClass="offersLikeButton personalBackgroundButton" value="#{messages.See}" oncomplete="offersDetailDialog.show();" update=":offersCandidateViewFormDialog:offerDetailDialogPanel" process="@parent" />
                                            </p:outputPanel>
                                    </p:panel> 
                                </p:column>
                            </p:dataGrid>
                    </p:panel>
                </h:form>
                <h:form id="offersCandidateViewFormDialog">
                    <p:dialog id="offersDetailDialog" widgetVar="offersDetailDialog" styleClass="noPaddingTitle" closable="true" hideEffect="fade" resizable="false"  >
                        <p:panel id="offerDetailDialogPanel" styleClass="noBorder noMargin noPadding offersDialogPanel" style="margin-top: -10px" header="#{offersCandidateBean.selectedSearch.description}">
                            <h:graphicImage value="/companyFiles/#{offersCandidateBean.selectedSearch.company.idCompany.toString()}/images/#{offersCandidateBean.selectedSearch.company.logo}" styleClass="marginTop20 imagenLogoOferta" style="max-width: 150px;max-height: 125px" rendered="#{offersCandidateBean.selectedSearch.company.logo!=null}" ></h:graphicImage>
                            <p:panelGrid columnClasses="columminwidth170" columns="2" styleClass="marginTop20" style="max-width: 500px">
                                <h:outputText value="#{messages.AvailableJobs}" rendered="#{offersCandidateBean.selectedSearch.availableJobs!=null}" ></h:outputText>
                                <h:outputText value="#{offersCandidateBean.selectedSearch.availableJobs}" rendered="#{offersCandidateBean.selectedSearch.availableJobs!=null}" ></h:outputText>
                                <h:outputText value="#{messages.OfferCountry}" rendered="#{offersCandidateBean.selectedSearch.offerCountry!=null}" ></h:outputText>
                                <h:outputText value="#{countryBundle[offersCandidateBean.selectedSearch.offerCountry.idCountry.toString()]}" rendered="#{offersCandidateBean.selectedSearch.offerCountry!=null}" ></h:outputText>
                                <h:outputText value="#{messages.OfferProvince}" rendered="#{offersCandidateBean.selectedSearch.offerProvince!=null}" ></h:outputText>
                                <h:outputText value="#{offersCandidateBean.selectedSearch.offerProvince.description}" rendered="#{offersCandidateBean.selectedSearch.offerProvince!=null}" ></h:outputText>
                                <h:outputText value="#{messages.Sector}" rendered="#{!offersCandidateBean.allSectorOfSelectedSearch.isEmpty()}" ></h:outputText>
                                <p:dataList styleClass="listGridInline" varStatus="professionalIteration" var="sector" value="#{offersCandidateBean.allSectorOfSelectedSearch}" rendered="#{!offersCandidateBean.allSectorOfSelectedSearch.isEmpty()}"> 
                                    <h:outputText value="#{sectorBundle[sector]}"></h:outputText>
                                    <h:outputText rendered="#{!professionalIteration.last}" value=", " ></h:outputText>
                                </p:dataList>
                                <h:outputText value="#{messages.Description}" rendered="#{offersCandidateBean.selectedSearch.comment!=null}"></h:outputText>
                                <h:outputText value="#{offersCandidateBean.selectedSearch.comment}" rendered="#{offersCandidateBean.selectedSearch.comment!=null}"> </h:outputText>
                            </p:panelGrid>
                        </p:panel> 
                    </p:dialog>
                    
                </h:form>

                
            </ui:define>
        </ui:composition>

    </body>
</html>

